{% extends "base.html" %}
{% load i18n %}

{% block main_content %}



<h2>Documents</h2>

<a href="{% url documents-new %}" class="add_doc">{% trans "New document" %}</a>

<table style="width: 70%">
<tr>
<td valign="top">
<table class="data" style="width: 80%">
	<tr>
		<th style="width: 1%"> </th>
		<th>Document</th>
		<th>Category</th>
	</tr>
	{% for doc in documents %}
	<tr>
		<td>
			{% if doc.public %}
				<img src="{{MEDIA_URL}}/img/doc.png">
			{%else%}
				<img src="{{MEDIA_URL}}/img/doc_private.png">
			{% endif %}
		</td>
		<td><a href="{% url documents-details doc.id %}">{{ doc.filename }}</a></td>
		<td>{{ doc.category }}</td>
	</tr>
	{% endfor %}
</table>
</td>
<td style="width: 30%"  valign="top">
	<div>
		<strong>{% trans "Search" %}</strong><br>
		<form action="{% url documents-list %}">
			<input name="q" value="{{ search_query }}"><input type="submit" value="{% trans "Find" %}">
		</form>
	</div>
	<strong>{% trans "Filter" %}</strong><br>
	
	<a href="{% url documents-list %}">{% trans "All categories"%}</a><br>
	{% for cat in categories %}
		<a href="{% url documents-list-cat cat.id %}">{{ cat.name }}</a><br>
	{% endfor %}
</td>
</table>

{% endblock main_content %}